%include
:- lib(ic), lib(listut).

testIntegerRangeIntegerRange(Path, OState, Arg, Result, NState) :-
	Path > 0,
	% Domains
	[First] :: -127 .. 128,
	[NFirst] :: -127 .. 128,
	[Last] :: -127 .. 128,
	[NLast] :: -127 .. 128,
	% Constraints
	Arg = [First, Last],
	NState = [NFirst, NLast],
	integerRangeIntegerRange(Path, OState, Arg, Result, NState),
	% Solving
	indomain(First),
	indomain(NFirst),
	indomain(Last),
	indomain(NLast).

integerRangeIntegerRange(1, [], [First, Last], [], [NStart, NEnd]) :-
	% Precondition
	First #=< Last,
	% Postcondition
	NStart #= First,
	NEnd #= Last,
	% Invariant
	NStart #=< NEnd.

